package com.liruo.learn.spring.mvc.config.mvc;

import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author:liruo
 * @Date:2023-05-03-21:04:51
 * @Desc
 */
//@Configuration
public class TestControllerConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/controller/not-found")
                .setStatusCode(HttpStatus.NOT_FOUND)
                .setViewName("404");
    }

}
